Skip to content

One stop judge for every ask, stop, block and extra fix round; the reviewer requests changes only for named problems; a replay suite of incidents - #495

Merged
nambok merged 2 commits into
mainfrom
feat/stop-judge
Nov 6, 2026
Merged

nambok merged 2 commits into
mainfrom
feat/stop-judge

Conversation

@nambok

@nambok nambok commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

CoderHelm felt dumb because narrow steps each picked the costly outcome when unsure: ask a person, stop, block, loop again. Every one of those decisions now goes through one stop judge that sees the whole run, on the strongest configured model at high effort. It proceeds on a written assumption (an Open item on the pull request), asks only for a fact only a person has (with what was tried, 2 to 4 options, a recommended default and a deadline), or holds only on a named blocker that cites checked evidence. A malformed answer is asked again once with the schema, then falls back to proceeding on reversible work, never to asking. A source test fails when any path asks a person, sets needs_input, requests changes or starts another fix cycle without the judge.

The reviewer follows the owner's policy: changes are requested only for a named correctness, security or data-loss problem with its location and evidence; every other finding is a Nit, Suggestion or FYI on the approval. A replay suite of real incidents gates every decision path and every model or effort change, and what people did after each decision is recorded, shown in Analytics and the weekly email, and exportable as new replay cases.

Changes

The stop judge (common/src/stop_judge.rs, worker/src/passes/stop_judge.rs)

  • Picture (ticket and acceptance criteria, related tickets and their PRs, plan, diff summary, CI and plan results, check and rule findings as evidence with ids, threads, budget, the proposed decision and its reason), Verdict (Proceed, Ask, Hold), validate (the rules above), fallback, and judge over a JudgeModel trait. Judged has a private field: only judge makes one.
  • Rule-settled decisions without a model call: no cycles left, or going on impossible (a repository not connected, a policy approval). Still recorded.
  • Every needs_input writer, every question writer, review_verdict::post for REQUEST_CHANGES, and CheckRecord::start_fix (through CycleLicence) take a judged decision; the source test every_costly_decision_goes_through_the_judge reads the worker's sources.
  • A question's default and deadline are kept on the run; the stuck-run sweep claims a passed deadline once and the worker restarts the ticket with the default as the answer.

Decision points, before and after (before: origin/main at bae8df9; after: this branch)

Decision Before After
Planner's clarification asked the planner's questions (mod.rs:2840) judged (mod.rs:2928); proceed plans again with the assumption as the answer; a second ask is a planner failure
Where the fix belongs (Route::Ask) asked (mod.rs:7093) judged before asking (mod.rs:2655); proceed codes the plan's files, or reports with nothing to code
Plan files don't match the repo asked (mod.rs:2544) judged (mod.rs:2543); proceed codes on the assumption
Coder built what it could, asks asked (mod.rs:4519) judged (mod.rs:4710); proceed fails the run to retry, never generic questions
No file changes two generic questions (mod.rs:4582) judged (mod.rs:4833); a repo not turned on is recorded as access only a person gives
Someone else's open PR asked (mod.rs:8527) judged (mod.rs:8859); proceed opens CoderHelm's own draft beside it
Repo not turned on needs_input (mod.rs:7686) recorded as a rule decision (mod.rs:8046)
Run guard / ceiling hand-off draft + needs_input (run_guard.rs:591, :631) judged (run_guard.rs:626, :663); the wait names the blocker or the assumption
Stopped after its work draft + needs_input (stop_pr.rs:68) judged (stop_pr.rs:78)
Fix rounds' hand-off needs_input (resume.rs:4896) judged (resume.rs:4944)
Proof, links, failing-test, new-feature rounds 2+ started on a count (proof.rs:1767, link_checks.rs:1329, test_fix.rs:2045, feature/mod.rs:1144) licensed by the judge (proof.rs:1739, link_checks.rs:1326, test_fix.rs:2031, feature/mod.rs:1073)
Own-review fix rounds 2+ on progress (resume.rs:2620) licensed by the judge (resume.rs:2622)
Policy approval wait needs_input (policy.rs:433) recorded as a rule decision (policy.rs:438)
Request changes posted on anything named (review_pr.rs:3064, review_verdict.rs:122) judged first (review_pr.rs:3077); post refuses without a judged hold (review_verdict.rs:125)

Not wired yet: CI auto-fix pushes (claim_auto_fix_slot), planned-work rounds (finish_planned::next), and the outside-the-code report (ends needs_outside_change, not needs_input).

Reviewer policy (review_severity.rs:289 classify, :194 label, :261 blocking_kind; review_agent.rs:832 decide_verdict)

  • Blocks only a correctness, security or data-loss problem, with a file, shown by evidence (code path, tests, CI, a data query, documentation). Questions, unconfirmed facts, team rules with no defect, preferences, optional improvements and unshown concerns are notes, labeled Nit, Suggestion or FYI in the posted comment. Review check shows every trigger; verdicts rest on a fingerprint and name what holds the merge #486's chokepoint and fingerprint are kept.
  • Repo setting migrated: "Require tests" made every missing-test finding blocking (review_agent.rs:603); it is now always posted as a Suggestion (CoderHelm still writes tests for its own changes). A test failing or proving nothing is still a correctness block. No stored settings change.
  • Unconfirmed facts are an "FYI: facts worth confirming" section; a description edit answering it still starts a re-review (description_review.rs).
  • Two review cases and five rubric tests updated to the policy; three audited "should have blocked" cases stay blocked (they show a defect), one moved to notes (a team rule with no defect).
  • Auto-merge rules unchanged.

Replay suite (worker/src/passes/replay/, CI step "Replay suite")

  • One JSON file per incident in cases/, run through the real decision functions and graded on the decision; pass^k with k = 3 recorded model answer lists where the judge is called. REPLAY_LIVE=1 runs the real model; REPLAY_RECORD=1 records fresh answers. README says how to add one.
  • Seeds: a feature phrased as a complaint with the planner's block missing (code, no question); a helper beside registered schema files (no block); gaps 2, 4, 3, 1 across 11 continuations (draft PR, stops by the 4th continuation, $16 at most); the same commit with every thread settled (approve); a comment naming a blocker on an unchanged commit (answered, no second review, no spliced text); deploys CoderHelm started (by cause); plus an extra fix cycle, a naming nit and an access question.

Outcome feedback (common/src/decision_log.rs, gateway/src/routes/decisions.rs)

  • Each decision is kept on the settings table (DECISION#RUN#…, DECISION#PR#…) with its picture and the model's answers. Outcomes land from answers (default or otherwise), Cancel and Close, Retry, a dismissed CoderHelm review, and a merge (flagged file unchanged or fixed).
  • GET /api/analytics/decisions (Unnecessary stops and Nuisance blocks: rate, count, categories, examples) and GET /api/analytics/decisions/export (confirmed-wrong decisions as replay cases). The weekly email gets a "Stops and blocks" line for members.

Model and effort (provider.rs:155 judgment_model_id; JUDGMENT_EFFORT = "high")

  • Judgment steps on the strongest configured model at high effort; the list is a test (judgment_steps_run_on_the_strongest_model_at_high_effort). Extraction, formatting and edits stay as they were.
  • Earlier cost cuts reverted, with estimates (prices from model_prices.json: Opus 5.5 $4/$20 per M in/out, Sonnet 5.5 $2/$10, cache reads $0.20 on both; token counts from code comments and sizes, not measured):
Step Was Now Estimated cost change
Review writing (#375) Sonnet unless the team chose a heavy model heavy model about 2x on that call's new input and output; cached reads unchanged
Plan review (#477) low effort high +~10k output tokens per reviewing agent, about +$0.20 on Opus
Code and description reviews (#477 kept medium) medium high about +30 to 60% output on those calls
Planner, triage x2, repo check, plan check, fix-location re-ask (#491 added low) primary or light model, triage/check at low heavy, high roughly +$0.5 to $1.5 per run, mostly the planner's tool turns
Question screening, covered-PR check, settled-question check, severity check, ask and reply classification, comment intent, open-PR choice, branch-update ask, duplicate-helper check light or primary, mostly low heavy, high (max_tokens raised for thinking) about $0.03 to $0.15 per call
Security review primary heavy about 2x on that pass
Stop judge (new) none one call per costly decision about $0.05 to $0.15 per decision

Overall: roughly +$1 to $3 per run and +$0.2 to $0.5 per review, against about $4 per 15-minute run step today. The replay suite gates any future downgrade.

Verification

  • cargo fmt --all --check and cargo clippy --workspace --all-targets -- -D warnings clean.
  • cargo test for common, gateway and worker: 1495, 745 and 1330 pass. New: the judge (validation, re-ask, fallback, rule settlement), the decision log (round trip, outcomes, summary, merge outcome, export), the source tests (costly paths, judgment model and effort), the replay suite (9 cases, pass^k), the weekly line, the sweep's deadline (Python, 361 pass).
  • The incident suite still passes, including the loop and run-ceiling cases (round licences adopted).
  • Not verified: no live model call was made (recorded answers only; the live and record modes need a key); nothing deployed; the outcome hooks and the deadline restart have not run against real GitHub events or DynamoDB; the "merged with flagged lines unchanged" outcome compares heads only (no file compare in the gateway yet).

…viewer requests changes only for named problems; a replay suite of incidents

Every costly decision (asking a person, stopping or waiting, requesting changes, a fix cycle beyond the first, handing a run off) goes through one judge that sees the whole run, on the strongest configured model at high effort. It proceeds on a written assumption, asks only for a fact only a person has (with options, a default and a deadline), or holds on a named, checked blocker. A source test fails on any path around it. The reviewer requests changes only for a named correctness, security or data-loss problem with its location and evidence; everything else is a Nit, Suggestion or FYI. A replay suite of incidents gates the decision paths and model or effort changes, and what people did after each decision is recorded for analytics, the weekly email and new replay cases.
@nambok
nambok merged commit f900ced into main Nov 6, 2026
10 checks passed
@nambok
nambok deleted the feat/stop-judge branch November 6, 2026 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant